package com.enjoy.redis.mq;

import org.junit.Test;
import redis.clients.jedis.Jedis;

public class ListTest {

    @Test
    public void test1() {
        Jedis jedis = new Jedis("192.168.126.128", 6379);

//        for (int i = 0; i < 100; i++) {
//            jedis.lpush("listKey", "value:"+i);
//        }
        jedis.lpush("listKey", "hello");
        System.out.println("放入listKey完成");
    }

    @Test
    public void test() {
        Jedis jedis = new Jedis("192.168.126.128", 6379);
        for (int i = 0; i < 100; i++) {
            String listKey = jedis.rpop("listKey");
        }

        System.out.println("listKey = " + jedis.brpop("listKey","60"));
    }

}
